export default {
  deleteEmpty (object) {
    for (let i in object) {
      var value = object[i]
      if (typeof value === 'object') {
        if (Array.isArray(value)) {
          if (value.length === 0) {
            delete object[i]
            continue
          }
        }
        this.deleteEmpty(value)
        if (this.isEmpty(value)) {
          delete object[i]
        }
      } else {
        if (value === '' || value === null || value === undefined) {
          delete object[i]
        } else {
        }
      }
    }
  },
  isEmpty (value) {
    for (let name in value) {
      return false
    }
    return true
  }
}
